package com.bingo.users.action;

import ibatis.Users;

import java.util.List;

import com.bingo.facade.IusersFacade;
import com.googlecode.jsonplugin.annotations.JSON;
import com.opensymphony.xwork2.ActionSupport;

public class GetUsersList extends ActionSupport {
	private String json;

	private Integer page;
	private Integer total;
	private List<Users> userList;
	private IusersFacade usersFacade;
	
	@Override
	public String execute() throws Exception {
		try {
			System.out.println("getAllUsers");
			userList=this.usersFacade.getAllUsers();
			page=1;
			total=200;
			json="jjj";
			//request.put("userList",list);
			//this.id=list.get(0).getUid();
			//this.name=list.get(0).getUsername();
			//this.email=list.get(0).getUseremail();
		} catch (Exception e) {
			e.printStackTrace();
			return "error";
		}
		return SUCCESS;
	}

	public String getJson() {
		return json;
	}
	public Integer getPage() {
		return page;
	}
	public Integer getTotal() {
		return total;
	}

	@JSON(name="rows")
	public List<Users> getUserList() {
		return userList;
	}

	public void setJson(String json) {
		this.json = json;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public void setUserList(List<Users> userList) {
		this.userList = userList;
	}

	public void setUsersFacade(IusersFacade usersFacade) {
		this.usersFacade = usersFacade;
	}
	
}
